package enterprise.manage.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


/**
 * Created by IntelliJ IDEA.
 * User: liyong
 * Date: 2010-8-25
 * Time: 15:10:30
 * Desc:partner实体类
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(schema = "mpi",name="MpiPartner")
public class Partner implements Serializable {
    /**
     * 私钥
     */
    private String privateKey;
    /**
     * 注册时间
     */
    private Date createTime;
    /**
     * 修改时间
     */
    private Date modifyTime;
    /**
     * 审核状态
     */
    private String checkStatus;
    /**
     * 审核时间
     */
    private Date checkTime;
    /**
     * 冻结状态
     */
    private String freezeStatus;
    /**
     * id
     */
    private Long id;
    /**
     * 名称
     */
    private String partnerName;
    /**
     * 密码
     */
    private String password;

    /**
     * 登录名
     */
    private String userName;

    /**
     * md5
     */
    private String md5Key;
    /**
     * 商户编号
     */
    private String partnerNo;
    /**
     * 返回地址
     */
    private String returnUrl;
    /**
     * 冻结时间
     */
    private Date freezeTime;
    /**
     * 激活状态
     */
    private String enabledStatus;
    /**
     * 激活时间
     */
    private Date enabledTime;
    /**
     * 余额
     */
    private String balance;
    /**
     * 公司名称
     */
    private String companyName;
    /**
     * 法人
     */
    private String legalName;
    /**
     * 营业执照注册号
     */
    private String businessLicenseNo;
    /**
     * 联系人
     */
    private String contactName;
    /**
     * 联系电话
     */
    private String telephone;
    /**
     * 手机
     */
    private String mobilePhone;
    /**
     * 地址
     */
    private String companyAddress;
    /**
     * 邮编
     */
    private String postCode;
    /**
     * 传真
     */
    private String fax;
    /**
     * 身份证号
     */
    private String idCardNo;
    /**
     * 简介
     */
    private String introduction;
    /**
     * 备注
     */
    private String remark;
    /**
     * 页面返回地址返回地址
     */
    private String pageReturnUrl;
    /**
     * 页面返回地址验证类型
     */
    private Integer pageValidateType;
    /**
     * 验证方式
     */
    private Integer validateType;
    /**
     * 注册ip
     */
    private String ip;
    /**
     * 费率
     */
    private Double rate;
    /**
     * 是否需要通知
     */
    private Integer isNeedNotify;
    /**
     * 是否需要手机通知
     */
    private Integer isMobileNotify;
    /**
     * 是否需要邮件通知
     */
    private Integer isMailNotify;
    /**
     * 通知手机号
     */
    private String notifyMobile;
    /**
     * 通知邮件地址
     */
    private String notifyMail;
    /**
     * 是否有子公司
     */
    private Integer hasChild;
    /**
     * 子公司数量
     */
    private Integer childCount;


    /**
     * 上级公司id
     */

    private Long fartherPId;

    private String legalIdNo;              //企业法人身份证号
    private String organizationNo;        //组织机构代码
    private String  businessScope;        //经营范围
    private String  businessTerm;         //营业期限


    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * 商户id get方法
     * @return id
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    /**
     * 设置id
     *
     * @param id id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 名称  get方法
     *
     * @return 名称
     */
    @Column(length = 50, nullable = true)
    public String getPartnerName() {
        return partnerName;
    }

    /**
     * 名称  set方法
     *
     * @param partnerName 商品编号
     */
    public void setPartnerName(String partnerName) {
        this.partnerName = partnerName;
    }

    /**
     * 密码  get方法
     *
     * @return 密码
     */
    @Column(length = 50, nullable = true)
    public String getPassword() {
        return password;
    }

    /**
     * 密码  set方法
     *
     * @param password 商品编号
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * MD5  get方法
     *
     * @return MD5
     */
    @Column(length = 50, nullable = true)
    public String getMd5Key() {
        return md5Key;
    }

    /**
     * md5  set方法
     *
     * @param md5Key 商品编号
     */
    public void setMd5Key(String md5Key) {
        this.md5Key = md5Key;
    }




    /**
     * 商品编号  get方法
     *
     * @return 商品编号
     */
    @Column(length = 50, nullable = true)
    public String getPartnerNo() {
        return partnerNo;
    }

    /**
     * 商品编号 set方法
     * @param  partnerNo  setPartnerNo
     */
    public void setPartnerNo(String partnerNo) {
        this.partnerNo = partnerNo;
    }

    /**
     * 返回地址 get
     * @return returnUrl
     */
    @Column(length = 250, nullable = true)
    public String getReturnUrl() {
        return returnUrl;
    }

    /**
     * 返回地址 set
     * @param returnUrl 返回地址
     */
    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }

    /**
     * @return privateKey
     */
    @Column(length = 50, nullable = true)
    public String getPrivateKey() {
        return privateKey;
    }

    /**
     * @param privateKey setPrivateKey
     */
    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    /**
     * @return createTime
     */
    @Column(nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime setCreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @return  modifyTime
     */
    @Temporal(value=TemporalType.TIMESTAMP)
    public Date getModifyTime() {
        return modifyTime;
    }

    /**
     * 修改时间 set
     * @param modifyTime 修改时间
     */
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    /**
     * 审核状态 get
     * @return 审核状态
     */
    @Column(length = 50, nullable = true)
    public String getCheckStatus() {
        return checkStatus;
    }

    /**
     * @param checkStatus setCheckStatus
     */
    public void setCheckStatus(String checkStatus) {
        this.checkStatus = checkStatus;
    }

    /**
     * @return checkTime
     */
    @Column(nullable = true)
    public Date getCheckTime() {
        return checkTime;
    }

    /**
     * @param checkTime setCheckTime
     */
    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }

    /**
     * @return  freezeStatus
     */
    @Column(length = 10, nullable = true)
    public String getFreezeStatus() {
        return freezeStatus;
    }

    /**
     * @param freezeStatus setFreezeStatus
     */
    public void setFreezeStatus(String freezeStatus) {
        this.freezeStatus = freezeStatus;
    }

    /**
     * @return freezeTime
     */
    @Column(nullable = true)
    public Date getFreezeTime() {
        return freezeTime;
    }

    /**
     * @param freezeTime  setFreezeTime
     */
    public void setFreezeTime(Date freezeTime) {
        this.freezeTime = freezeTime;
    }

    /**
     * @return enabledStatus
     */
    @Column(length = 10, nullable = true)
    public String getEnabledStatus() {
        return enabledStatus;
    }

    /**
     * @param enabledStatus setEnabledStatus
     */
    public void setEnabledStatus(String enabledStatus) {
        this.enabledStatus = enabledStatus;
    }

    /**
     * @return enabledTime
     */
    @Column(nullable = true)
    public Date getEnabledTime() {
        return enabledTime;
    }

    /**
     * @param enabledTime setEnabledTime
     */
    public void setEnabledTime(Date enabledTime) {
        this.enabledTime = enabledTime;
    }

    /**
     * @return balance
     */
    @Column(nullable = true)
    public String getBalance() {
        return balance;
    }

    /**
     * @param balance setBalance
     */
    public void setBalance(String balance) {
        this.balance = balance;
    }

    /**
     * @return companyName
     */
    @Column(length = 50, nullable = true)
    public String getCompanyName() {
        return companyName;
    }

    /**
     * @param companyName  setCompanyName
     */
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    /**
     * @return legalName
     */
    @Column(length = 50, nullable = true)
    public String getLegalName() {
        return legalName;
    }

    /**
     * @param legalName  setLegalName
     */
    public void setLegalName(String legalName) {
        this.legalName = legalName;
    }

    /**
     * @return businessLicenseNo
     */
    @Column(length = 50, nullable = true)
    public String getBusinessLicenseNo() {
        return businessLicenseNo;
    }

    /**
     * @param businessLicenseNo setBusinessLicenseNo
     */
    public void setBusinessLicenseNo(String businessLicenseNo) {
        this.businessLicenseNo = businessLicenseNo;
    }

    /**
     * @return contactName
     */
    @Column(length = 50, nullable = true)
    public String getContactName() {
        return contactName;
    }

    /**
     * @param contactName  setContactName
     */
    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    /**
     * @return telephone
     */
    @Column(length = 50, nullable = true)
    public String getTelephone() {
        return telephone;
    }

    /**
     * @param telephone setTelephone
     */
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /**
     * @return mobilePhone
     */
    @Column(length = 50, nullable = true)
    public String getMobilePhone() {
        return mobilePhone;
    }

    /**
     * @param mobilePhone setMobilePhone
     */
    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    /**
     * @return companyAddress
     */
    @Column(length = 250, nullable = true)
    public String getCompanyAddress() {
        return companyAddress;
    }

    /**
     * @param companyAddress  setCompanyAddress
     */
    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    /**
     * @return postCode
     */
    @Column(length = 6, nullable = true)
    public String getPostCode() {
        return postCode;
    }

    /**
     * @param postCode setPostCode
     */
    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    /**
     * @return fax
     */
    @Column(length = 30, nullable = true)
    public String getFax() {
        return fax;
    }

    /**
     * @param fax  setFax
     */
    public void setFax(String fax) {
        this.fax = fax;
    }

    /**
     * @return  idCardNo
     */
    @Column(length = 20, nullable = true)
    public String getIdCardNo() {
        return idCardNo;
    }

    /**
     * @param idCardNo setIdCardNo
     */
    public void setIdCardNo(String idCardNo) {
        this.idCardNo = idCardNo;
    }

    /**
     * @return introduction
     */
    @Column(length = 250, nullable = true)
    public String getIntroduction() {
        return introduction;
    }

    /**
     * @param introduction setIntroduction
     */
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    /**
     * @return  remark
     */
    @Column(length = 250, nullable = true)
    public String getRemark() {
        return remark;
    }

    /**
     * @param remark setRemark
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getPageReturnUrl() {
        return pageReturnUrl;
    }

    public void setPageReturnUrl(String pageReturnUrl) {
        this.pageReturnUrl = pageReturnUrl;
    }

    public Integer getPageValidateType() {
        return pageValidateType;
    }

    public void setPageValidateType(Integer pageValidateType) {
        this.pageValidateType = pageValidateType;
    }

    public Integer getValidateType() {
        return validateType;
    }

    public void setValidateType(Integer validateType) {
        this.validateType = validateType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getIsNeedNotify() {
        return isNeedNotify;
    }

    public void setIsNeedNotify(Integer isNeedNotify) {
        this.isNeedNotify = isNeedNotify;
    }

    public Integer getIsMobileNotify() {
        return isMobileNotify;
    }

    public void setIsMobileNotify(Integer isMobileNotify) {
        this.isMobileNotify = isMobileNotify;
    }

    public Integer getIsMailNotify() {
        return isMailNotify;
    }

    public void setIsMailNotify(Integer isMailNotify) {
        this.isMailNotify = isMailNotify;
    }

    public String getNotifyMobile() {
        return notifyMobile;
    }

    public void setNotifyMobile(String notifyMobile) {
        this.notifyMobile = notifyMobile;
    }

    public String getNotifyMail() {
        return notifyMail;
    }

    public void setNotifyMail(String notifyMail) {
        this.notifyMail = notifyMail;
    }

    public Integer getHasChild() {
        return hasChild;
    }

    public void setHasChild(Integer hasChild) {
        this.hasChild = hasChild;
    }

    public Integer getChildCount() {
        return childCount;
    }

    public void setChildCount(Integer childCount) {
        this.childCount = childCount;
    }

    public Long getFartherPId() {
        return fartherPId;
    }

    public void setFartherPId(Long fartherPId) {
        this.fartherPId = fartherPId;
    }
    public String getLegalIdNo() {
           return legalIdNo;
       }

       public void setLegalIdNo(String legalIdNo) {
           this.legalIdNo = legalIdNo;
       }

       public String getOrganizationNo() {
           return organizationNo;
       }

       public void setOrganizationNo(String organizationNo) {
           this.organizationNo = organizationNo;
       }

       public String getBusinessScope() {
           return businessScope;
       }

       public void setBusinessScope(String businessScope) {
           this.businessScope = businessScope;
       }

       public String getBusinessTerm() {
           return businessTerm;
       }

       public void setBusinessTerm(String businessTerm) {
           this.businessTerm = businessTerm;
       }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Partner partner = (Partner) o;

        if (balance != null ? !balance.equals(partner.balance) : partner.balance != null) return false;
        if (businessLicenseNo != null ? !businessLicenseNo.equals(partner.businessLicenseNo) : partner.businessLicenseNo != null)
            return false;
        if (checkStatus != null ? !checkStatus.equals(partner.checkStatus) : partner.checkStatus != null) return false;
        if (checkTime != null ? !checkTime.equals(partner.checkTime) : partner.checkTime != null) return false;
        if (childCount != null ? !childCount.equals(partner.childCount) : partner.childCount != null) return false;
        if (companyAddress != null ? !companyAddress.equals(partner.companyAddress) : partner.companyAddress != null)
            return false;
        if (companyName != null ? !companyName.equals(partner.companyName) : partner.companyName != null) return false;
        if (contactName != null ? !contactName.equals(partner.contactName) : partner.contactName != null) return false;
        if (createTime != null ? !createTime.equals(partner.createTime) : partner.createTime != null) return false;
        if (enabledStatus != null ? !enabledStatus.equals(partner.enabledStatus) : partner.enabledStatus != null)
            return false;
        if (enabledTime != null ? !enabledTime.equals(partner.enabledTime) : partner.enabledTime != null) return false;
        if (fartherPId != null ? !fartherPId.equals(partner.fartherPId) : partner.fartherPId != null) return false;
        if (fax != null ? !fax.equals(partner.fax) : partner.fax != null) return false;
        if (freezeStatus != null ? !freezeStatus.equals(partner.freezeStatus) : partner.freezeStatus != null)
            return false;
        if (freezeTime != null ? !freezeTime.equals(partner.freezeTime) : partner.freezeTime != null) return false;
        if (hasChild != null ? !hasChild.equals(partner.hasChild) : partner.hasChild != null) return false;
        if (id != null ? !id.equals(partner.id) : partner.id != null) return false;
        if (idCardNo != null ? !idCardNo.equals(partner.idCardNo) : partner.idCardNo != null) return false;
        if (introduction != null ? !introduction.equals(partner.introduction) : partner.introduction != null)
            return false;
        if (ip != null ? !ip.equals(partner.ip) : partner.ip != null) return false;
        if (isMailNotify != null ? !isMailNotify.equals(partner.isMailNotify) : partner.isMailNotify != null)
            return false;
        if (isMobileNotify != null ? !isMobileNotify.equals(partner.isMobileNotify) : partner.isMobileNotify != null)
            return false;
        if (isNeedNotify != null ? !isNeedNotify.equals(partner.isNeedNotify) : partner.isNeedNotify != null)
            return false;
        if (legalName != null ? !legalName.equals(partner.legalName) : partner.legalName != null) return false;
        if (md5Key != null ? !md5Key.equals(partner.md5Key) : partner.md5Key != null) return false;
        if (mobilePhone != null ? !mobilePhone.equals(partner.mobilePhone) : partner.mobilePhone != null) return false;
        if (modifyTime != null ? !modifyTime.equals(partner.modifyTime) : partner.modifyTime != null) return false;
        if (notifyMail != null ? !notifyMail.equals(partner.notifyMail) : partner.notifyMail != null) return false;
        if (notifyMobile != null ? !notifyMobile.equals(partner.notifyMobile) : partner.notifyMobile != null)
            return false;
        if (pageReturnUrl != null ? !pageReturnUrl.equals(partner.pageReturnUrl) : partner.pageReturnUrl != null)
            return false;
        if (pageValidateType != null ? !pageValidateType.equals(partner.pageValidateType) : partner.pageValidateType != null)
            return false;
        if (partnerName != null ? !partnerName.equals(partner.partnerName) : partner.partnerName != null) return false;
        if (partnerNo != null ? !partnerNo.equals(partner.partnerNo) : partner.partnerNo != null) return false;
        if (password != null ? !password.equals(partner.password) : partner.password != null) return false;
        if (postCode != null ? !postCode.equals(partner.postCode) : partner.postCode != null) return false;
        if (privateKey != null ? !privateKey.equals(partner.privateKey) : partner.privateKey != null) return false;
        if (rate != null ? !rate.equals(partner.rate) : partner.rate != null) return false;
        if (remark != null ? !remark.equals(partner.remark) : partner.remark != null) return false;
        if (returnUrl != null ? !returnUrl.equals(partner.returnUrl) : partner.returnUrl != null) return false;
        if (telephone != null ? !telephone.equals(partner.telephone) : partner.telephone != null) return false;
        if (userName != null ? !userName.equals(partner.userName) : partner.userName != null) return false;
        if (validateType != null ? !validateType.equals(partner.validateType) : partner.validateType != null)
            return false;

        return true;
    }

    @Override
    public String toString() {
        return "Partner{" +
                "privateKey='" + privateKey + '\'' +
                ", createTime=" + createTime +
                ", modifyTime=" + modifyTime +
                ", checkStatus='" + checkStatus + '\'' +
                ", checkTime=" + checkTime +
                ", freezeStatus='" + freezeStatus + '\'' +
                ", id=" + id +
                ", partnerName='" + partnerName + '\'' +
                ", password='" + password + '\'' +
                ", userName='" + userName + '\'' +
                ", md5Key='" + md5Key + '\'' +
                ", partnerNo='" + partnerNo + '\'' +
                ", returnUrl='" + returnUrl + '\'' +
                ", freezeTime=" + freezeTime +
                ", enabledStatus='" + enabledStatus + '\'' +
                ", enabledTime=" + enabledTime +
                ", balance='" + balance + '\'' +
                ", companyName='" + companyName + '\'' +
                ", legalName='" + legalName + '\'' +
                ", businessLicenseNo='" + businessLicenseNo + '\'' +
                ", contactName='" + contactName + '\'' +
                ", telephone='" + telephone + '\'' +
                ", mobilePhone='" + mobilePhone + '\'' +
                ", companyAddress='" + companyAddress + '\'' +
                ", postCode='" + postCode + '\'' +
                ", fax='" + fax + '\'' +
                ", idCardNo='" + idCardNo + '\'' +
                ", introduction='" + introduction + '\'' +
                ", remark='" + remark + '\'' +
                ", pageReturnUrl='" + pageReturnUrl + '\'' +
                ", pageValidateType=" + pageValidateType +
                ", validateType=" + validateType +
                ", ip='" + ip + '\'' +
                ", rate=" + rate +
                ", isNeedNotify=" + isNeedNotify +
                ", isMobileNotify=" + isMobileNotify +
                ", isMailNotify=" + isMailNotify +
                ", notifyMobile='" + notifyMobile + '\'' +
                ", notifyMail='" + notifyMail + '\'' +
                ", hasChild=" + hasChild +
                ", childCount=" + childCount +
                ", fartherPId=" + fartherPId +
                '}';
    }
}

